<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
<head>
  <meta http-equiv='X-UA-Compatible' content='IE=edge' />
  <meta http-equiv='MSThemeCompatible' content='Yes'>

  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <title>ADO</title>
  <style type="text/css">
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
  </style>
  <style type="text/css">@font-face {font-family: octicons-link;src: url(data:font/woff;charset=utf-8;base64,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) format('woff');}body {-webkit-text-size-adjust: 100%;text-size-adjust: 100%;color: #333;font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size: 16px;line-height: 1.6;word-wrap: break-word;max-width: 99%;box-sizing: border-box;padding: 20px 5px 8rem 5px; margin-left: auto;margin-right: auto;}body a {background-color: transparent;}body a:active,body a:hover {outline: 0;}body strong {font-weight: bold;}body h1 {font-size: 2em;margin: 0.67em 0;}body img {border: 0;}body hr {box-sizing: content-box;height: 0;}body pre {overflow: auto;}body code,body kbd,body pre {font-family: monospace, monospace;font-size: 1em;}body input {color: inherit;font: inherit;margin: 0;}body html input[disabled] {cursor: default;}body input {line-height: normal;}body input[type="checkbox"] {box-sizing: border-box;padding: 0;}body table {border-collapse: collapse;border-spacing: 0;}body td,body th {padding: 0;}body * {box-sizing: border-box;}body input {font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";}body a {color: #4078c0;text-decoration: none;}body a:hover,body a:active {text-decoration: underline;}body hr {height: 0;margin: 15px 0;overflow: hidden;background: transparent;border: 0;border-bottom: 1px solid #ddd;}body hr:before {display: table;content: "";}body hr:after {display: table;clear: both;content: "";}body h1,body h2,body h3,body h4,body h5,body h6 {margin-top: 15px;margin-bottom: 15px;line-height: 1.1;}body h1 {font-size: 30px;}body h2 {font-size: 21px;}body h3 {font-size: 16px;}body h4 {font-size: 14px;}body h5 {font-size: 12px;}body h6 {font-size: 11px;}body blockquote {margin: 0;}body ul,body ol {padding: 0;margin-top: 0;margin-bottom: 0;}body ol ol,body ul ol {list-style-type: lower-roman;}body ul ul ol,body ul ol ol,body ol ul ol,body ol ol ol {list-style-type: lower-alpha;}body dd {margin-left: 0;}body code {font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;font-size: 12px;}body pre {margin-top: 0;margin-bottom: 0;font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;}body .select::-ms-expand {opacity: 0;}body .octicon {font: normal normal normal 16px/1 octicons-link;display: inline-block;text-decoration: none;text-rendering: auto;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}body .octicon-link:before {content: '\f05c';}body:before {display: table;content: "";}body:after {display: table;clear: both;content: "";}body>*:first-child {margin-top: 0 !important;}body>*:last-child {margin-bottom: 0 !important;}body a:not([href]) {color: inherit;text-decoration: none;}body .anchor {display: inline-block;padding-right: 2px;margin-left: -18px;}body .anchor:focus {outline: none;}body h1,body h2,body h3,body h4,body h5,body h6 {margin-top: 1em;margin-bottom: 16px;font-weight: bold;line-height: 1.4;}body h1 .octicon-link,body h2 .octicon-link,body h3 .octicon-link,body h4 .octicon-link,body h5 .octicon-link,body h6 .octicon-link {color: #000;vertical-align: middle;visibility: hidden;}body h1:hover .anchor,body h2:hover .anchor,body h3:hover .anchor,body h4:hover .anchor,body h5:hover .anchor,body h6:hover .anchor {text-decoration: none;}body h1:hover .anchor .octicon-link,body h2:hover .anchor .octicon-link,body h3:hover .anchor .octicon-link,body h4:hover .anchor .octicon-link,body h5:hover .anchor .octicon-link,body h6:hover .anchor .octicon-link {visibility: visible;}body h1 {padding-bottom: 0.3em;font-size: 1.75em;line-height: 1.2;}body h1 .anchor {line-height: 1;}body h2 {padding-bottom: 0.3em;font-size: 1.5em;line-height: 1.225;}body h2 .anchor {line-height: 1;}body h3 {font-size: 1.25em;line-height: 1.43;}body h3 .anchor {line-height: 1.2;}body h4 {font-size: 1em;}body h4 .anchor {line-height: 1.2;}body h5 {font-size: 1em;}body h5 .anchor {line-height: 1.1;}body h6 {font-size: 1em;color: #777;}body h6 .anchor {line-height: 1.1;}body p,body blockquote,body ul,body ol,body dl,body table,body pre {margin-top: 0;margin-bottom: 16px;}body hr {height: 4px;padding: 0;margin: 16px 0;background-color: #e7e7e7;border: 0 none;}body ul,body ol {padding-left: 2em;}body ul ul,body ul ol,body ol ol,body ol ul {margin-top: 0;margin-bottom: 0;}body li>p {margin-top: 16px;}body dl {padding: 0;}body dl dt {padding: 0;margin-top: 16px;font-size: 1em;font-style: italic;font-weight: bold;}body dl dd {padding: 0 16px;margin-bottom: 16px;}body blockquote {padding: 0 15px;color: #777;border-left: 4px solid #ddd;}body blockquote>:first-child {margin-top: 0;}body blockquote>:last-child {margin-bottom: 0;}body table {display: block;width: 100%;overflow: auto;word-break: normal;word-break: keep-all;}body table th {font-weight: bold;}body table th,body table td {padding: 6px 13px;border: 1px solid #ddd;}body table tr {background-color: #fff;border-top: 1px solid #ccc;}body table tr:nth-child(2n) {background-color: #f8f8f8;}body img {max-width: 100%;box-sizing: content-box;background-color: #fff;}body code {padding: 0;padding-top: 0;padding-bottom: 0;margin: 0;font-size: 85%;background-color: rgba(0,0,0,0.04);border-radius: 3px;}body code:before,body code:after {letter-spacing: -0.2em;content: "\00a0";}body pre>code {padding: 0;margin: 0;font-size: 100%;word-break: normal;white-space: pre;background: transparent;border: 0;}body .highlight {margin-bottom: 16px;}body .highlight pre,body pre {padding: 16px;overflow: auto;font-size: 85%;line-height: 1.45;background-color: #f7f7f7;border-radius: 3px;}body .highlight pre {margin-bottom: 0;word-break: normal;}body pre {word-wrap: normal;}body pre code {display: inline;max-width: initial;padding: 0;margin: 0;overflow: initial;line-height: inherit;word-wrap: normal;background-color: transparent;border: 0;}body pre code:before,body pre code:after {content: normal;}body kbd {display: inline-block;padding: 3px 5px;font-size: 11px;line-height: 10px;color: #555;vertical-align: middle;background-color: #fcfcfc;border: solid 1px #ccc;border-bottom-color: #bbb;border-radius: 3px;box-shadow: inset 0 -1px 0 #bbb;}body .pl-c {color: #969896;}body .pl-c1,body .pl-s .pl-v {color: #0086b3;}body .pl-e,body .pl-en {color: #795da3;}body .pl-s .pl-s1,body .pl-smi {color: #333;}body .pl-ent {color: #63a35c;}body .pl-k {color: #a71d5d;}body .pl-pds,body .pl-s,body .pl-s .pl-pse .pl-s1,body .pl-sr,body .pl-sr .pl-cce,body .pl-sr .pl-sra,body .pl-sr .pl-sre {color: #183691;}body .pl-v {color: #ed6a43;}body .pl-id {color: #b52a1d;}body .pl-ii {background-color: #b52a1d;color: #f8f8f8;}body .pl-sr .pl-cce {color: #63a35c;font-weight: bold;}body .pl-ml {color: #693a17;}body .pl-mh,body .pl-mh .pl-en,body .pl-ms {color: #1d3e81;font-weight: bold;}body .pl-mq {color: #008080;}body .pl-mi {color: #333;font-style: italic;}body .pl-mb {color: #333;font-weight: bold;}body .pl-md {background-color: #ffecec;color: #bd2c00;}body .pl-mi1 {background-color: #eaffea;color: #55a532;}body .pl-mdr {color: #795da3;font-weight: bold;}body .pl-mo {color: #1d3e81;}body kbd {display: inline-block;padding: 3px 5px;font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;line-height: 10px;color: #555;vertical-align: middle;background-color: #fcfcfc;border: solid 1px #ccc;border-bottom-color: #bbb;border-radius: 3px;box-shadow: inset 0 -1px 0 #bbb;}body .task-list-item {list-style-type: none;}body .task-list-item+.task-list-item {margin-top: 3px;}body .task-list-item input {margin: 0 0.35em 0.25em -1.6em;vertical-align: middle;}body :checked+.radio-label {z-index: 1;position: relative;border-color: #4078c0;}</style>
  
    
  
</head>
<body>
<h1 id="cadodb">CADODB</h1>
<p>Microsoft ActiveX Data Objects (ADO) enable your client applications to access and manipulate data from a variety of sources through an OLE DB provider. Its primary benefits are ease of use, high speed, low memory overhead, and a small disk footprint. ADO supports key features for building client/server and Web-based applications.</p>
<p><code>CADODB</code> are a collection of classes to allow to work with ADO using the FreeBasic compilers.</p>
<p>The <code>CADOBase</code> object, from which the other ADO classes inherit, initializes and uninitializes the COM library and implements two methods, <strong>GetLastResult</strong> and <strong>SetResult</strong> used by the derived classes to store the result codes of ADO calls.</p>
<p><strong>Folder</strong>: Afx/CADODB<br> <strong>Files</strong>: CADODB.inc, CADOCommand.inc, CADOConnection.inc, CADOErrors.inc, CADOFields.inc, CADOParameters.inc, CADOProperties.inc, CADORecord.inc, CADORecordset.inc, CADOStream.inc.</p>
<table>
<thead>
<tr class="header">
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><a href="#CADOBase">CADOBase Class</a></td>
<td>Base class for all the other ADO classes.</td>
</tr>
<tr class="even">
<td><a href="#ADOObjectModel">ADO Object Model</a></td>
<td>ADO objects and their collections.</td>
</tr>
<tr class="odd">
<td><a href="#ADOIdentifiers">ADO Identifiers</a></td>
<td>PROGIDs, CLSIDs and IIDs.</td>
</tr>
<tr class="even">
<td><a href="#ADOErrors">ADO Errors</a></td>
<td>ADO errors.</td>
</tr>
<tr class="odd">
<td><a href="#ADOProperties">ADO Properties</a></td>
<td>Represents a dynamic characteristic of an ADO object that is defined by the provider.</td>
</tr>
</tbody>
</table>
<h1 id="cadobase-class"><a name="CADOBase"></a>CADOBase Class</h1>
<p>The <strong>CAdoBase</strong> class, from which the other ADO classes inherit, initializes and uninitializes the COM library and implements two methods, <strong>GetLastResult</strong> and <strong>SetResult</strong> used by the derived classes to store the result codes of ADO calls.</p>
<h3 id="getlastresult"><a name="GetLastResult"></a>GetLastResult</h3>
<p>Returns the last result code.</p>
<pre><code>FUNCTION GetLastResult () AS HRESULT
</code></pre>
<h3 id="setresult"><a name="SetResult"></a>SetResult</h3>
<p>Sets the last result code.</p>
<pre><code>FUNCTION SetResult (BYVAL Result AS HRESULT) AS HRESULT
</code></pre>
<h4 id="return-value">Return value</h4>
<p>The result code returned by the last executed method.</p>
<h1 id="ado-object-model"><a name="ADOObjectModel"></a>ADO Object Model</h1>
<p>ADO objects and their collections:</p>
<pre><code>Connection
  |_ Errors     - Error
  |_ Properties - Property

Command
  |_ Parameters - Parameter
  |_ Properties - Property

Recordset
  |_ Fields - Field
  |_ Properties - Property

Record
  |_ Fields - Field

Stream
</code></pre>
<h1 id="ado-identifiers"><a name="ADOIdentifiers"></a>ADO Identifiers</h1>
<pre><code>' ========================================================================================
' ProgIDs (Program identifiers)
' ========================================================================================

' CLSID = {00000507-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Command60 = &quot;ADODB.Command.6.0&quot;
' CLSID = {00000514-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Connection60 = &quot;ADODB.Connection.6.0&quot;
' CLSID = {0000050B-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Parameter60 = &quot;ADODB.Parameter.6.0&quot;
' CLSID = {00000560-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Record60 = &quot;ADODB.Record.6.0&quot;
' CLSID = {00000535-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Recordset60 = &quot;ADODB.Recordset.6.0&quot;
' CLSID = {00000566-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Stream60 = &quot;ADODB.Stream.6.0&quot;

' ========================================================================================
' Version independent ProgIDs
' ========================================================================================

' CLSID = {00000507-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Command = &quot;ADODB.Command&quot;
' CLSID = {00000514-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Connection = &quot;ADODB.Connection&quot;
' CLSID = {0000050B-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Parameter = &quot;ADODB.Parameter&quot;
' CLSID = {00000560-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Record = &quot;ADODB.Record&quot;
' CLSID = {00000535-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Recordset = &quot;ADODB.Recordset&quot;
' CLSID = {00000566-0000-0010-8000-00AA006D2EA4}
CONST AFX_PROGID_Stream = &quot;ADODB.Stream&quot;

' ========================================================================================
' ClsIDs (Class identifiers)
' ========================================================================================

CONST AFX_CLSID_Command = &quot;{00000507-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_CLSID_Connection = &quot;{00000514-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_CLSID_Parameter = &quot;{0000050B-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_CLSID_Record = &quot;{00000560-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_CLSID_Recordset = &quot;{00000535-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_CLSID_Stream = &quot;{00000566-0000-0010-8000-00AA006D2EA4}&quot;

' ========================================================================================
' IIDs (Interface identifiers)
' ========================================================================================

CONST AFX_IID_ADO = &quot;{00000534-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Collection = &quot;{00000512-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Command = &quot;{986761E8-7269-4890-AA65-AD7C03697A6D}&quot;
CONST AFX_IID_Connection = &quot;{00001550-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_DynaCollection = &quot;{00000513-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Parameter = &quot;{0000150C-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Record = &quot;{00001562-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Recordset = &quot;{00001556-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Stream = &quot;{00001565-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ADOCommandConstruction = &quot;{00000517-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ADOConnectionConstruction = &quot;{00000551-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ADORecordConstruction = &quot;{00000567-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ADORecordsetConstruction = &quot;{00000283-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ADOStreamConstruction = &quot;{00000568-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ConnectionEvents = &quot;{00001400-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_ConnectionEventsVt = &quot;{00001402-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Error = &quot;{00000500-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Errors = &quot;{00000501-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Field = &quot;{00001569-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Fields = &quot;{00001564-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Fields_Deprecated = &quot;{00000564-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Parameters = &quot;{0000150D-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Properties = &quot;{00000504-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_Property = &quot;{00000503-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_RecordsetEvents = &quot;{00001266-0000-0010-8000-00AA006D2EA4}&quot;
CONST AFX_IID_RecordsetEventsVt = &quot;{00001403-0000-0010-8000-00AA006D2EA4}&quot;
</code></pre>
<h1 id="ado-errors"><a name="ADOErrors"></a>ADO Errors</h1>
<p>Any operation involving ADO objects can generate one or more provider errors. As each error occurs, one or more <strong>Error</strong> objects can be placed in the <strong>Errors collection</strong> of the <strong>Connection object</strong>. When another ADO operation generates an error, the <strong>Errors</strong> collection is cleared, and the new set of <strong>Error</strong> objects can be placed in the <strong>Errors</strong> collection.</p>
<p>Each <strong>Error</strong> object represents a specific provider error, not an ADO error. ADO operations that don't generate an error have no effect on the <strong>Errors</strong> collection. Use the <strong>Clear</strong> method to manually clear the <strong>Errors</strong> collection.</p>
<p>The set of <strong>Error</strong> objects in the <strong>Errors</strong> collection describes all errors that occurred in response to a single statement. Enumerating the specific errors in the <strong>Errors</strong> collection enables your error-handling routines to more precisely determine the cause and origin of an error, and take appropriate steps to recover.</p>
<p>Some properties and methods return warnings that appear as <strong>Error</strong> objects in the <strong>Errors</strong> collection but do not halt a program's execution. Before you call the <strong>Resync</strong>, <strong>UpdateBatch</strong>, or <strong>CancelBatch</strong> methods on a <strong>Recordset</strong> object, the <strong>Open</strong> method on a <strong>Connection</strong> object, or set the <strong>Filter</strong> property on a <strong>Recordset</strong> object, call the <strong>Clear</strong> method on the <strong>Errors</strong> collection. That way you can read the <strong>Count</strong> property of the <strong>Errors</strong> collection to test for returned warnings.</p>
<p>The <strong>Error</strong> object contains details about data access errors that pertain to a single operation involving the provider. Any operation involving ADO objects can generate one or more provider errors. As each error occurs, one or more <strong>Error</strong> objects are placed in the <strong>Errors</strong> collection of the <strong>Connection</strong> object. When another ADO operation generates an error, the <strong>Errors</strong> collection is cleared, and the new set of <strong>Error</strong> objects is placed in the <strong>Errors</strong> collection.</p>
<p><strong>Note</strong>: Each <strong>Error</strong> object represents a specific provider error, not an ADO error. ADO errors are exposed to the run-time exception-handling mechanism. For example, in Microsoft Visual Basic, the occurrence of an ADO-specific error will trigger an <strong>On Error</strong> event and appear in the <strong>Error</strong> object. For a complete list of ADO errors, see the <strong>ErrorValueEnum</strong> table below.</p>
<p>You can read an <strong>Error</strong> object's properties to obtain specific details about each error, including the following:</p>
<ul>
<li>The <strong>Description</strong> property, which contains the text of the error. This is the default property.</li>
<li>The <strong>Number</strong> property, which contains the Long integer value of the error constant.</li>
<li>The <strong>Source</strong> property, which identifies the object that raised the error. This is particularly useful when you have several Error objects in the Errors collection following a request to a data source.</li>
<li>The <strong>SQLState</strong> and <strong>NativeError</strong> properties, which provide information from SQL data sources.</li>
</ul>
<p>When a provider error occurs, it is placed in the <strong>Errors</strong> collection of the <strong>Connection</strong> object. ADO supports the return of multiple errors by a single ADO operation to allow for error information specific to the provider. To obtain this rich error information in an error handler, use the appropriate error-trapping features of the language or environment you are working with, then use nested loops to enumerate the properties of each <strong>Error</strong> object in the <strong>Errors</strong> collection.</p>
<p>To retrieve information about ADO errors, call the following function:</p>
<pre><code>FUNCTION AfxAdoGetErrorInfo (BYVAL pConnection AS AFX_ADOConnection PTR, BYVAL nError AS HRESULT = 0) AS CBSTR
</code></pre>
<p>Where <em>pConnection</em> is a reference to the ADO <strong>Connection</strong> object and <em>nError</em> the ADO HRESULT code.</p>
<h3 id="errorvalueenum-enumeration">ErrorValueEnum Enumeration</h3>
<p>Specifies the type of ADO run-time error.</p>
<p>Three forms of the error number are listed:</p>
<ul>
<li>Positive decimal—the low two bytes of the full number in decimal format.</li>
<li>Negative decimal—The decimal translation of the full error number.</li>
<li>Hexadecimal—The hexadecimal representation of the full error number. The Windows facility code is in the fourth digit. The facility code for ADO error numbers is A. For example: &amp;H800A0E7B.</li>
</ul>
<p><strong>Note</strong>: OLE DB errors may be passed to your ADO application. Typically, these can be identified by a Windows facility code of 4. For example, &amp;H8004....</p>
<table>
<thead>
<tr class="header">
<th>Constant</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><strong>adErrBoundToCommand</strong></td>
<td>3707<br>-2146824581<br>&amp;H800A0E7B</td>
<td>Cannot change the <strong>ActiveConnection</strong> property of a <strong>Recordset</strong> object which has a <strong>Command</strong> object as its source.</td>
</tr>
<tr class="even">
<td><strong>adErrCannotComplete</strong></td>
<td>3732<br>-2146824556<br>&amp;H800A0E94</td>
<td>Server cannot complete the operation.</td>
</tr>
<tr class="odd">
<td><strong>adErrCantChangeConnection</strong></td>
<td>3748<br>-2146824540<br>&amp;H800A0EA4</td>
<td>Connection was denied. New connection you requested has different characteristics than the one already in use.</td>
</tr>
<tr class="even">
<td><strong>adErrCantChangeProvider</strong></td>
<td>3220<br>-2146825068<br>&amp;H800A0C94</td>
<td>Supplied provider is different from the one already in use.</td>
</tr>
<tr class="odd">
<td><strong>adErrCantConvertvalue</strong></td>
<td>3724<br>-2146824564<br>&amp;H800A0E8C</td>
<td>Data value cannot be converted for reasons other than sign mismatch or data overflow. For example, conversion would have truncated data.</td>
</tr>
<tr class="even">
<td><strong>adErrCantCreate</strong></td>
<td>3725<br>-2146824563<br>&amp;H800A0E8D</td>
<td>Data value cannot be set or retrieved because the field data type was unknown, or the provider had insufficient resources to perform the operation.</td>
</tr>
<tr class="odd">
<td><strong>adErrCatalogNotSet</strong></td>
<td>3747<br>-2146824541<br>&amp;H800A0EA3</td>
<td>Operation requires a valid <strong>ParentCatalog</strong>.</td>
</tr>
<tr class="even">
<td><strong>adErrColumnNotOnThisRow</strong></td>
<td>3726<br>-2146824562<br>&amp;H800A0E8E</td>
<td>Record does not contain this field.</td>
</tr>
<tr class="odd">
<td><strong>adErrDataConversion</strong></td>
<td>3421<br>-2146824867<br>&amp;H800A0D5D</td>
<td>Application uses a value of the wrong type for the current operation.</td>
</tr>
<tr class="even">
<td><strong>adErrDataOverflow</strong></td>
<td>3721<br>-2146824567<br>&amp;H800A0E89</td>
<td>Data value is too large to be represented by the field data type.</td>
</tr>
<tr class="odd">
<td><strong>adErrDelResOutOfScope</strong></td>
<td>3738<br>-2146824550<br>&amp;H800A0E9A</td>
<td>URL of the object to be deleted is outside the scope of the current record.</td>
</tr>
<tr class="even">
<td><strong>adErrDenyNotSupported</strong></td>
<td>3750<br>-2146824538<br>&amp;H800A0EA6</td>
<td>Provider does not support sharing restrictions.</td>
</tr>
<tr class="odd">
<td><strong>adErrDenyTypeNotSupported</strong></td>
<td>3751<br>-2146824537<br>&amp;H800A0EA7</td>
<td>Provider does not support the requested kind of sharing restriction.</td>
</tr>
<tr class="even">
<td><strong>adErrFeatureNotAvailable</strong></td>
<td>3251<br>-2146825037<br>&amp;H800A0CB3</td>
<td>Object or provider is not capable of performing requested operation.</td>
</tr>
<tr class="odd">
<td><strong>adErrFieldsUpdateFailed</strong></td>
<td>3749<br>-2146824539<br>&amp;H800A0EA5</td>
<td>Fields update failed. For further information, examine the Status property of individual field objects.</td>
</tr>
<tr class="even">
<td><strong>adErrIllegalOperation</strong></td>
<td>3219<br>-2146825069<br>&amp;H800A0C93</td>
<td>Operation is not allowed in this context.</td>
</tr>
<tr class="odd">
<td><strong>adErrIntegrityViolation</strong></td>
<td>3719<br>-2146824569<br>&amp;H800A0E87</td>
<td>Data value conflicts with the integrity constraints of the field.</td>
</tr>
<tr class="even">
<td><strong>adErrInTransaction</strong></td>
<td>3246<br>-2146825042<br>&amp;H800A0CAE</td>
<td>Connection object cannot be explicitly closed while in a transaction.</td>
</tr>
<tr class="odd">
<td><strong>adErrInvalidArgument</strong></td>
<td>3001<br>-2146825287<br>&amp;H800A0BB9</td>
<td>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.</td>
</tr>
<tr class="even">
<td><strong>adErrInvalidConnection</strong></td>
<td>3709<br>-2146824579<br>&amp;H800A0E7D</td>
<td>The connection cannot be used to perform this operation. It is either closed or invalid in this context.</td>
</tr>
<tr class="odd">
<td><strong>adErrInvalidParamInfo</strong></td>
<td>3708<br>-2146824580<br>&amp;H800A0E7C</td>
<td>Parameter object is improperly defined. Inconsistent or incomplete information was provided.</td>
</tr>
<tr class="even">
<td><strong>adErrInvalidTransaction</strong></td>
<td>3714<br>-2146824574<br>&amp;H800A0E82</td>
<td>Coordinating transaction is invalid or has not started.</td>
</tr>
<tr class="odd">
<td><strong>adErrInvalidURL</strong></td>
<td>3729<br>-2146824559<br>&amp;H800A0E91</td>
<td>URL contains invalid characters. Make sure the URL is typed correctly.</td>
</tr>
<tr class="even">
<td><strong>adErrItemNotFound</strong></td>
<td>3265<br>-2146825023<br>&amp;H800A0CC1</td>
<td>Item cannot be found in the collection corresponding to the requested name or ordinal.</td>
</tr>
<tr class="odd">
<td><strong>adErrNoCurrentRecord</strong></td>
<td>3021<br>-2146825267<br>&amp;H800A0BCD</td>
<td>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.</td>
</tr>
<tr class="even">
<td><strong>adErrNotExecuting</strong></td>
<td>3715<br>-2146824573<br>&amp;H800A0E83</td>
<td>Operation cannot be performed while not executing.</td>
</tr>
<tr class="odd">
<td><strong>adErrNotReentrant</strong></td>
<td>3710<br>-2146824578<br>&amp;H800A0E7E</td>
<td>Operation cannot be performed while processing event.</td>
</tr>
<tr class="even">
<td><strong>adErrObjectClosed</strong></td>
<td>3704<br>-2146824584<br>&amp;H800A0E78</td>
<td>Operation is not allowed when the object is closed.</td>
</tr>
<tr class="odd">
<td><strong>adErrObjectInCollection</strong></td>
<td>3367<br>-2146824921<br>&amp;H800A0D27</td>
<td>Object is already in collection. Cannot append.</td>
</tr>
<tr class="even">
<td><strong>adErrObjectNotSet</strong></td>
<td>3420<br>-2146824868<br>&amp;H800A0D5C</td>
<td>Object is no longer valid.</td>
</tr>
<tr class="odd">
<td><strong>adErrObjectOpen</strong></td>
<td>3705<br>-2146824583<br>&amp;H800A0E79</td>
<td>Operation is not allowed when the object is open.</td>
</tr>
<tr class="even">
<td><strong>adErrOpeningFile</strong></td>
<td>3002<br>-2146825286<br>&amp;H800A0BBA</td>
<td>File could not be opened.</td>
</tr>
<tr class="odd">
<td><strong>adErrOperationCancelled</strong></td>
<td>3712<br>-2146824576<br>&amp;H800A0E80</td>
<td>Operation has been cancelled by the user.</td>
</tr>
<tr class="even">
<td><strong>adErrOutOfSpace</strong></td>
<td>3734<br>-2146824554<br>&amp;H800A0E96</td>
<td>Operation cannot be performed. Provider cannot obtain enough storage space.</td>
</tr>
<tr class="odd">
<td><strong>adErrPermissionDenied</strong></td>
<td>3720<br>-2146824568<br>&amp;H800A0E88</td>
<td>Insufficent permission prevents writing to the field.</td>
</tr>
<tr class="even">
<td><strong>adErrProviderFailed</strong></td>
<td>3000<br>-2146825288<br>&amp;H800A0BB8</td>
<td>Provider failed to perform the requested operation.</td>
</tr>
<tr class="odd">
<td><strong>adErrProviderNotFound</strong></td>
<td>3706<br>-2146824582<br>&amp;H800A0E7A</td>
<td>Provider cannot be found. It may not be properly installed.</td>
</tr>
<tr class="even">
<td><strong>adErrReadFile</strong></td>
<td>3003<br>-2146825285<br>&amp;H800A0BBB</td>
<td>File could not be read.</td>
</tr>
<tr class="odd">
<td><strong>adErrResourceExists</strong></td>
<td>3731<br>-2146824557<br>&amp;H800A0E93</td>
<td>Copy operation cannot be performed. Object named by destination URL already exists. Specify <strong>adCopyOverwrite</strong> to replace the object.</td>
</tr>
<tr class="even">
<td><strong>adErrResourceLocked</strong></td>
<td>3730<br>-2146824558<br>&amp;H800A0E92</td>
<td>Object represented by the specified URL is locked by one or more other processes. Wait until the process has finished and attempt the operation again.</td>
</tr>
<tr class="odd">
<td><strong>adErrResourceOutOfScope</strong></td>
<td>3735<br>-2146824553<br>&amp;H800A0E97</td>
<td>Source or destination URL is outside the scope of the current record.</td>
</tr>
<tr class="even">
<td><strong>adErrSchemaViolation</strong></td>
<td>3722<br>-2146824566<br>&amp;H800A0E8A</td>
<td>Data value conflicts with the data type or constraints of the field.</td>
</tr>
<tr class="odd">
<td><strong>adErrSignMismatch</strong></td>
<td>3723<br>-2146824565<br>&amp;H800A0E8B</td>
<td>Conversion failed because the data value was signed and the field data type used by the provider was unsigned.</td>
</tr>
<tr class="even">
<td><strong>adErrStillConnecting</strong></td>
<td>3713<br>-2146824575<br>&amp;H800A0E81</td>
<td>Operation cannot be performed while connecting asynchronously.</td>
</tr>
<tr class="odd">
<td><strong>adErrStillExecuting</strong></td>
<td>3711<br>-2146824577<br>&amp;H800A0E7F</td>
<td>Operation cannot be performed while executing asynchronously.</td>
</tr>
<tr class="even">
<td><strong>adErrTreePermissionDenied</strong></td>
<td>3728<br>-2146824560<br>&amp;H800A0E90</td>
<td>Permissions are insufficient to access tree or subtree.</td>
</tr>
<tr class="odd">
<td><strong>adErrUnavailable</strong></td>
<td>3736<br>-2146824552<br>&amp;H800A0E98</td>
<td>Operation failed to complete and the status is unavailable. The field may be unavailable or the operation was not attempted.</td>
</tr>
<tr class="even">
<td><strong>adErrUnsafeOperation</strong></td>
<td>3716<br>-2146824572<br>&amp;H800A0E84</td>
<td>Safety settings on this computer prohibit accessing a data source on another domain.</td>
</tr>
<tr class="odd">
<td><strong>adErrURLDoesNotExist</strong></td>
<td>3727<br>-2146824561<br>&amp;H800A0E8F</td>
<td>Either the source URL or the parent of the destination URL does not exist.</td>
</tr>
<tr class="even">
<td><strong>adErrURLNamedRowDoesNotExist</strong></td>
<td>3737<br>-2146824551<br>&amp;H800A0E99</td>
<td>Record named by this URL does not exist.</td>
</tr>
<tr class="odd">
<td><strong>adErrVolumeNotFound</strong></td>
<td>3733<br>-2146824555<br>&amp;H800A0E95</td>
<td>Provider cannot locate the storage device indicated by the URL. Make sure the URL is typed correctly.</td>
</tr>
<tr class="even">
<td><strong>adErrWriteFile</strong></td>
<td>3004<br>-2146825284<br>&amp;H800A0BBC</td>
<td>Write to file failed.</td>
</tr>
<tr class="odd">
<td><strong>adWrnSecurityDialog</strong></td>
<td>3717<br>-2146824571<br>&amp;H800A0E85</td>
<td>For internal use only. Don't use.</td>
</tr>
<tr class="even">
<td><strong>adWrnSecurityDialogHeader</strong></td>
<td>3718<br>-2146824570<br>&amp;H800A0E86</td>
<td>For internal use only. Don't use.</td>
</tr>
</tbody>
</table>
<h1 id="ado-properties"><a name="ADOProperties"></a>ADO Properties</h1>
<p>Represents a dynamic characteristic of an ADO object that is defined by the provider.</p>
<p>ADO objects have two types of properties: built-in and dynamic.</p>
<p>Built-in properties are those properties implemented in ADO and immediately available to any new object, using the <em>MyObject.Property</em> syntax. They do not appear as <strong>Property</strong> objects in an object's <strong>Properties</strong> collection, so although you can change their values, you cannot modify their characteristics.</p>
<p>Dynamic properties are defined by the underlying data provider, and appear in the <strong>Properties</strong> collection for the appropriate ADO object. For example, a property specific to the provider may indicate if a <strong>Recordset</strong> object supports transactions or updating. These additional properties will appear as <strong>Property</strong> objects in that <strong>Recordset</strong> object's <strong>Properties</strong> collection. Dynamic properties can be referenced only through the collection, using the <em>MyObject.Properties(0)</em> or <em>MyObject.Properties(&quot;Name&quot;)</em> syntax.</p>
<p>You cannot delete either kind of property.</p>
<p>A dynamic <strong>Property</strong> object has four built-in properties of its own:</p>
<ul>
<li>The <strong>Name</strong> property is a string that identifies the property.</li>
<li>The <strong>Type_</strong> property is an integer that specifies the property data type.</li>
<li>The <strong>Value</strong> property is a variant that contains the property setting. <strong>Value</strong> is the default property for a <strong>Property</strong> object.</li>
<li>The <strong>Attributes</strong> property is a long value that indicates characteristics of the property specific to the provider.</li>
</ul>
<p>The <strong>Properties</strong> collection contains all the <strong>Property</strong> objects for a specific instance of an object.</p>
<h1 id="cadoproperty-class-methods">CADOProperty Class Methods</h1>
<p><strong>Include file</strong>: CAdoProperties.inc (include CADODB.inc).</p>
<h2 id="attributes-(cadoproperty-class)">Attributes (CADOProperty Class)</h2>
<p>For a <strong>Property</strong> object, the <strong>Attributes</strong> property is read-only, and its value can be the sum of any one or more <strong>PropertyAttributesEnum</strong> values.</p>
<pre><code>PROPERTY Attributes () AS LONG
PROPERTY Attributes (BYVAL lAttr AS LONG)
</code></pre>
<table>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><em>lAttr</em></td>
<td>Can be the sum of any one or more <strong>ParameterAttributesEnum</strong> values. The default is <strong>adParamSigned</strong>.</td>
</tr>
</tbody>
</table>
<h4 id="return-value-1">Return value</h4>
<p>LONG. One or more <strong>ParameterAttributesEnum</strong> values.</p>
<h4 id="propertyattributesenum">PropertyAttributesEnum</h4>
<table>
<thead>
<tr class="header">
<th>Constant</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><strong>adPropNotSupported</strong></td>
<td>Indicates that the property is not supported by the provider.</td>
</tr>
<tr class="even">
<td><strong>adPropRequired</strong></td>
<td>Indicates that the user must specify a value for this property before the data source is initialized.</td>
</tr>
<tr class="odd">
<td><strong>adPropOptional</strong></td>
<td>Indicates that the user does not need to specify a value for this property before the data source is initialized.</td>
</tr>
<tr class="even">
<td><strong>adPropRead</strong></td>
<td>Indicates that the user can read the property.</td>
</tr>
<tr class="odd">
<td><strong>adPropWrite</strong></td>
<td>Indicates that the user can set the property.</td>
</tr>
</tbody>
</table>
<h4 id="remarks">Remarks</h4>
<p>When you set multiple attributes, you can sum the appropriate constants. If you set the property value to a sum including incompatible constants, an error occurs.</p>
<h4 id="remote-data-service-usage">Remote Data Service Usage</h4>
<p>This property is not available on a client-side <strong>Connection</strong> object.</p>
<h4 id="example">Example</h4>
<pre><code>#include &quot;Afx/CADODB/CADODB.inc&quot;
using Afx

' // Open the connection
DIM pConnection AS CAdoConnection
pConnection.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=biblio.mdb&quot;

' // Open the recordset
DIM pRecordset AS CAdoRecordset
DIM cbsSource AS CBSTR = &quot;SELECT * FROM Publishers ORDER BY PubID&quot;
DIM hr AS HRESULT = pRecordset.Open(cbsSource, pConnection, adOpenKeyset, adLockOptimistic, adCmdText)

' // Parse the Properties collection
DIM pProperties AS CAdoProperties = pRecordset.Properties
DIM nCount AS LONG = pProperties.Count
FOR i AS LONG = 0 TO nCount - 1
   DIM pProperty AS CAdoProperty = pProperties.Item(i)
   PRINT &quot;Property name: &quot;; pProperty.Name; &quot; - Attributes: &quot;; WSTR(pProperty.Attributes)
NEXT
</code></pre>
<h2 id="name-(cadoproperty-class)">Name (CADOProperty Class)</h2>
<p>Returns the name of a <strong>Property</strong>.</p>
<pre><code>PROPERTY Name () AS CBSTR
</code></pre>
<h4 id="example-1">Example</h4>
<pre><code>#include &quot;Afx/CADODB/CADODB.inc&quot;
using Afx

' // Open the connection
DIM pConnection AS CAdoConnection
pConnection.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=biblio.mdb&quot;

' // Open the recordset
DIM pRecordset AS CAdoRecordset
DIM cvSource AS CVAR = &quot;SELECT * FROM Publishers ORDER BY PubID&quot;
DIM hr AS HRESULT = pRecordset.Open(cvSource, pConnection, adOpenKeyset, adLockOptimistic, adCmdText)

' // Parse the Properties collection
DIM pProperties AS CAdoProperties = pRecordset.Properties
DIM nCount AS LONG = pProperties.Count
FOR i AS LONG = 0 TO nCount - 1
   DIM pProperty AS CAdoProperty = pProperties.Item(i)
   PRINT &quot;Property name: &quot;; pProperty.Name; &quot; - Attributes: &quot;; WSTR(pProperty.Attributes)
NEXT
</code></pre>
<h2 id="type_-(cadoproperty-class)">Type_ (CADOProperty Class)</h2>
<p>Returns a <strong>DataTypeEnum</strong> value that indicates the operational type or data type of a <strong>Property</strong> object.</p>
<pre><code>PROPERTY Type_ () AS DataTypeEnum
</code></pre>
<h4 id="datatypeenum">DataTypeEnum</h4>
<table>
<thead>
<tr class="header">
<th>Constant</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>*<em>AdArray</em></td>
<td>A flag value, always combined with another data type constant, that indicates an array of that other data type.</td>
</tr>
<tr class="even">
<td><strong>adBigInt</strong></td>
<td>Indicates an eight-byte signed integer (DBTYPE_I8).</td>
</tr>
<tr class="odd">
<td><strong>adBinary</strong></td>
<td>Indicates a binary value (DBTYPE_BYTES).</td>
</tr>
<tr class="even">
<td><strong>adBoolean</strong></td>
<td>Indicates a boolean value (DBTYPE_BOOL).</td>
</tr>
<tr class="odd">
<td><strong>adBSTR</strong></td>
<td>Indicates a null-terminated character string (Unicode) (DBTYPE_BSTR).</td>
</tr>
<tr class="even">
<td><strong>adChapter</strong></td>
<td>Indicates a four-byte chapter value that identifies rows in a child rowset (DBTYPE_HCHAPTER).</td>
</tr>
<tr class="odd">
<td><strong>adChar</strong></td>
<td>Indicates a string value (DBTYPE_STR).</td>
</tr>
<tr class="even">
<td><strong>adCurrency</strong></td>
<td>Indicates a currency value (DBTYPE_CY). Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an eight-byte signed integer scaled by 10,000.</td>
</tr>
<tr class="odd">
<td><strong>adDate</strong></td>
<td>Indicates a date value (DBTYPE_DATE). A date is stored as a double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day.</td>
</tr>
<tr class="even">
<td><strong>adDBDate</strong></td>
<td>Indicates a date value (yyyymmdd) (DBTYPE_DBDATE).</td>
</tr>
<tr class="odd">
<td><strong>adDBTime</strong></td>
<td>Indicates a time value (hhmmss) (DBTYPE_DBTIME).</td>
</tr>
<tr class="even">
<td><strong>adDBTimeStamp</strong></td>
<td>Indicates a date/time stamp (yyyymmddhhmmss plus a fraction in billionths) (DBTYPE_DBTIMESTAMP).</td>
</tr>
<tr class="odd">
<td><strong>adDecimal</strong></td>
<td>Indicates an exact numeric value with a fixed precision and scale (DBTYPE_DECIMAL).</td>
</tr>
<tr class="even">
<td><strong>adDouble</strong></td>
<td>Indicates a double-precision floating-point value (DBTYPE_R8).</td>
</tr>
<tr class="odd">
<td><strong>adEmpty</strong></td>
<td>Specifies no value (DBTYPE_EMPTY).</td>
</tr>
<tr class="even">
<td><strong>adError</strong></td>
<td>Indicates a 32-bit error code (DBTYPE_ERROR).</td>
</tr>
<tr class="odd">
<td><strong>adFileTime</strong></td>
<td>Indicates a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (DBTYPE_FILETIME).</td>
</tr>
<tr class="even">
<td><strong>adGUID</strong></td>
<td>Indicates a globally unique identifier (GUID) (DBTYPE_GUID).</td>
</tr>
<tr class="odd">
<td><strong>adIDispatch</strong></td>
<td>Indicates a pointer to an IDispatch interface on a COM object (DBTYPE_IDISPATCH). This data type is currently not supported by ADO. Usage may cause unpredictable results.</td>
</tr>
<tr class="even">
<td><strong>adInteger</strong></td>
<td>Indicates a four-byte signed integer (DBTYPE_I4).</td>
</tr>
<tr class="odd">
<td><strong>adIUnknown</strong></td>
<td>Indicates a pointer to an IUnknown interface on a COM object (DBTYPE_IUNKNOWN). This data type is currently not supported by ADO. Usage may cause unpredictable results.</td>
</tr>
<tr class="even">
<td><strong>adLongVarBinary</strong></td>
<td>Indicates a long binary value.</td>
</tr>
<tr class="odd">
<td><strong>adLongVarChar</strong></td>
<td>Indicates a long string value.</td>
</tr>
<tr class="even">
<td><strong>adLongVarWChar</strong></td>
<td>Indicates a long null-terminated Unicode string value.</td>
</tr>
<tr class="odd">
<td><strong>adNumeric</strong></td>
<td>Indicates an exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC).</td>
</tr>
<tr class="even">
<td><strong>adPropVariant</strong></td>
<td>Indicates an Automation PROPVARIANT (DBTYPE_PROP_VARIANT).</td>
</tr>
<tr class="odd">
<td><strong>adSingle</strong></td>
<td>Indicates a single-precision floating-point value (DBTYPE_R4).</td>
</tr>
<tr class="even">
<td><strong>adSmallInt</strong></td>
<td>Indicates a two-byte signed integer (DBTYPE_I2).</td>
</tr>
<tr class="odd">
<td><strong>adTinyInt</strong></td>
<td>Indicates a one-byte signed integer (DBTYPE_I1).</td>
</tr>
<tr class="even">
<td><strong>adUnsignedBigInt</strong></td>
<td>Indicates an eight-byte unsigned integer (DBTYPE_UI8).</td>
</tr>
<tr class="odd">
<td><strong>adUnsignedInt</strong></td>
<td>Indicates a four-byte unsigned integer (DBTYPE_UI4).</td>
</tr>
<tr class="even">
<td><strong>adUnsignedSmallInt</strong></td>
<td>Indicates a two-byte unsigned integer (DBTYPE_UI2).</td>
</tr>
<tr class="odd">
<td><strong>adUnsignedTinyInt</strong></td>
<td>Indicates a one-byte unsigned integer (DBTYPE_UI1).</td>
</tr>
<tr class="even">
<td><strong>adVarBinary</strong></td>
<td>Indicates a binary value.</td>
</tr>
<tr class="odd">
<td><strong>adVarChar</strong></td>
<td>Indicates a string value.</td>
</tr>
<tr class="even">
<td><strong>adVariant</strong></td>
<td>Indicates an Automation Variant (DBTYPE_VARIANT). This data type is currently not supported by ADO. Usage may cause unpredictable results.</td>
</tr>
<tr class="odd">
<td><strong>adVarNumeric</strong></td>
<td>Indicates a numeric value.</td>
</tr>
<tr class="even">
<td><strong>adVarWChar</strong></td>
<td>Indicates a null-terminated Unicode character string.</td>
</tr>
<tr class="odd">
<td><strong>adWChar</strong></td>
<td>Indicates a null-terminated Unicode character string (DBTYPE_WSTR).</td>
</tr>
</tbody>
</table>
<h4 id="example-2">Example</h4>
<pre><code>#include &quot;Afx/CADODB/CADODB.inc&quot;
using Afx

' // Open the connection
DIM pConnection AS CAdoConnection
pConnection.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=biblio.mdb&quot;

' // Open the recordset
DIM pRecordset AS CAdoRecordset
DIM cvSource AS CVAR = &quot;SELECT * FROM Publishers ORDER BY PubID&quot;
DIM hr AS HRESULT = pRecordset.Open(cvSource, pConnection, adOpenKeyset, adLockOptimistic, adCmdText)

' // Parse the Properties collection
DIM pProperties AS CAdoProperties = pRecordset.Properties
DIM nCount AS LONG = pProperties.Count
FOR i AS LONG = 0 TO nCount - 1
   DIM pProperty AS CAdoProperty = pProperties.Item(i)
   PRINT &quot;Property name: &quot;; pProperty.Name; &quot; - Type: &quot;; WSTR(pProperty.Type_)
NEXT
</code></pre>
<h2 id="value-(cadoproperty-class)">Value (CADOProperty Class)</h2>
<p>Sets or returns a Variant value that indicates the value of the object. Default value depends on the <strong>Type_</strong> property.</p>
<pre><code>PROPERTY Value () AS CVAR
PROPERTY Value (BYREF cvValue AS CVAR)
</code></pre>
<table>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><em>cvValue</em></td>
<td>CVAR. The value of the <strong>Property</strong> object.</td>
</tr>
</tbody>
</table>
<h4 id="example-3">Example</h4>
<pre><code>#include &quot;Afx/CADODB/CADODB.inc&quot;
using Afx

' // Open the connection
DIM pConnection AS CAdoConnection
pConnection.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=biblio.mdb&quot;

' // Open the recordset
DIM pRecordset AS CAdoRecordset
DIM cvSource AS CVAR = &quot;SELECT * FROM Publishers ORDER BY PubID&quot;
DIM hr AS HRESULT = pRecordset.Open(cvSource, pConnection, adOpenKeyset, adLockOptimistic, adCmdText)

' // Parse the Properties collection
DIM pProperties AS CAdoProperties = pRecordset.Properties
DIM nCount AS LONG = pProperties.Count
FOR i AS LONG = 0 TO nCount - 1
   DIM pProperty AS CAdoProperty = pProperties.Item(i)
   PRINT &quot;Property name: &quot;; pProperty.Name; &quot; - Value: &quot;; WSTR(pProperty.Value)
NEXT
</code></pre>
<h1 id="cadoproperties-class-methods">CADOProperties Class Methods</h1>
<p><strong>Include file</strong>: CAdoProperties.inc (include CADODB.inc).</p>
<h2 id="count-(cadoproperties-class)">Count (CADOProperties Class)</h2>
<p>Retrieves the number of objects of the <strong>Properties</strong> collection.</p>
<pre><code>PROPERTY Count () AS LONG
</code></pre>
<h4 id="remarks-1">Remarks</h4>
<p>Because numbering for members of a collection begins with zero, you should always code loops starting with the zero member and ending with the value of the Count property minus 1.</p>
<p>If the <strong>Count</strong> property is zero, there are no objects in the collection.</p>
<h2 id="item-(cadoproperties-class)">Item (CADOProperties Class)</h2>
<p>Indicates a specific member of the <strong>Properties</strong> collection, by name or ordinal number.</p>
<pre><code>PROPERTY Item (BYREF cvIndex AS CVAR) AS Afx_ADOProperty PTR
</code></pre>
<table>
<thead>
<tr class="header">
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><em>cvIndex</em></td>
<td>A Variant expression that evaluates either to the name or to the ordinal number of an object in a collection.</td>
</tr>
</tbody>
</table>
<h4 id="return-value-2">Return value</h4>
<p>An <strong>Afx_ADOProperty</strong> object reference.</p>
<h4 id="remarks-2">Remarks</h4>
<p>If <strong>Item</strong> cannot find an object in the collection corresponding to the <strong>Index</strong> argument, an error occurs.</p>
<h2 id="refresh-(cadoproperties-class)">Refresh (CADOProperties Class)</h2>
<p>Refreshes the contents of the <strong>Properties</strong> collection.</p>
<pre><code>FUNCTION Refresh () AS HRESULT
</code></pre>
<h4 id="return-value-3">Return value</h4>
<p>S_OK (0) or an HRESULT code.</p>
<h4 id="remarks-3">Remarks</h4>
<p>Using the <strong>Refresh</strong> method on a <strong>Properties</strong> collection of some objects populates the collection with the dynamic properties that the provider exposes. These properties provide information about functionality specific to the provider, beyond the built-in properties ADO supports.</p>
</body>
</html>

